#coding:utf8
from flask import Flask,render_template
from flask_sqlalchemy import SQLAlchemy
from werkzeug.security import generate_password_hash
import pymysql

app = Flask(__name__)
app.debug=True
app.config["SQLALCHEMY_DATABASE_URI"] = "mysql+pymysql://root:1234@localhost:3306/movie?charset=utf8"
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = True
app.config["SECRET_KEY"]='sc123456'
db = SQLAlchemy(app,use_native_unicode="utf8")

from app.admin import admin as admin_blueprint
from app.home import home as home_blueprint
app.register_blueprint(home_blueprint)
app.register_blueprint(admin_blueprint,url_prefix="/admin")


@app.errorhandler(404)
def page_not_found(error):
    return render_template("home/404.html"),404